package mail.message;

import javax.mail.Message;

import mail.db.DataBase;
import mail.owner.Owner;

public class MailThread {
	/**
	 * MySQL table name for threads
	 */
	public static final String TABLE = "threads";
	
	/**
	 * MySQL column name for id
	 */
	public static final String ID = "id";
	
	/**
	 * MySQL column name for subject
	 */
	public static final String SUBJECT = "subject";
	
	/**
	 * MySQL column name for owner
	 */
	public static final String OWNER = "owner";
	
	/**
	 * Database connection
	 */
	private DataBase db;
	
	/**
	 * Thread id
	 */
	private int id;
	
	/**
	 * Thread subject (no RE or FWD)
	 */
	private String subject;
	
	/**
	 * Thread owner
	 */
	private Owner owner;
	
	public MailThread(int id) {
		this(id, DataBase.getInstance());
	}
	
	private MailThread(int id, DataBase db) {
		this.id = id;
		this.db = db;
	}
	
	public MailThread(Owner owner, String subject) {
		this(owner, subject, DataBase.getInstance());
	}
	
	private MailThread(Owner owner, String subject, DataBase db) {
		this.owner = owner;
		this.subject = subject;
		this.db = db;
	}
	
	public void addMessage() {
		
	}
	
	public Message[] getMessages() {
		return null;
	}
	
	public int getID() { return id; }
	public String getSubject() { return subject; }
	public Owner getOwner() { return owner; }
}
